[In]
print ("How old are you?"),
age=input()
print('How much is this?'),
price=input()
result=f"So,you are {age} years olds and this thing is {price} dollars"
#day3學到的字串格式化
#記住前面要f然後兩邊要加"{}"
result
[Out]
How old are you?
55
How much is this?
55
'So,you are 55 years olds and this thing is 55 dollars'
e.g
[In]
age=input("What is your name?")
price=input("How much is this?")
result=f"So,you are {age} years olds and this thing is {price} dollars"
#day3學到的字串格式化
#記住前面要f然後兩邊要加"{}"
result
[Out]
What is your name? 6
How much is this? 9
'So,you are 6 years olds and this thing is 9 dollars'